//
//  AnotherTableViewController.m
//  TakeHer
//
//  Created by Jupiter on 15/6/28.
//  Copyright (c) 2015年 蓝鸥科技. All rights reserved.
//

#import "AnotherTableViewController.h"

@interface AnotherTableViewController ()


@property (nonatomic, retain) UITableView *tableView;
@end

@implementation AnotherTableViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    [self createUI];
    UIImageView *titleImage = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, APP_WIDTH, APP_HEIGHT / 3)];
    //titleImage.backgroundColor = [UIColor yellowColor];
    [self.view addSubview:titleImage];
    NSLog(@"%@",self.dic);
    [titleImage setImageWithURL:[NSURL URLWithString:self.dic[@"cover_route_map_cover"]]];
    
    UILabel *titleLabel = [[UILabel alloc]
initWithFrame:CGRectMake(0, titleImage.frame.origin.y + APP_HEIGHT / 3, APP_WIDTH,50)];
    //titleLabel.backgroundColor = [UIColor yellowColor];
    [self.view addSubview:titleLabel];
    titleLabel.text =self.dic[@"name"];
    titleLabel.textColor = [UIColor orangeColor];
    titleLabel.textAlignment = 1;
    
    UITextView *textView = [[UITextView alloc]initWithFrame:CGRectMake(10, titleLabel.frame.origin.y + 50, APP_WIDTH - 20, 300)];
    [self.view addSubview:textView];
    textView.text = self.dic[@"description"];
    textView.editable =NO;

    
    
}

-(void) createUI
{
    self.tableView = [[UITableView alloc]initWithFrame:CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, [UIScreen mainScreen].bounds.size.height)];
    
    self.tableView.delegate = self;
    
    self.tableView.dataSource = self;
    
    [self.view addSubview:self.tableView];
    
}


-(NSInteger) tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 2;
}

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cellIdq"];
    
    if (!cell) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cellIdq"];
    }
    
    return cell;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
